package com.lab.idea.bl.service.impl;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;
import com.lab.idea.bl.entity.ExcelDocx;
import com.lab.idea.bl.mapper.ExcelDocxMapper;
import com.lab.idea.bl.service.ExcelDocxService;
import com.lab.idea.common.exception.LabException;
import com.lab.idea.mybatis.service.impl.LabServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 报告 服务实现类
 * </p>
 *
 * @author lab
 * @since 2023-11-14
 */
@Service
public class ExcelDocxServiceImpl extends LabServiceImpl<ExcelDocxMapper, ExcelDocx> implements ExcelDocxService {


    @Override
    protected boolean saveCheck(ExcelDocx entity) {
        /*JSONArray array = JSONUtil.parseArray(entity.getJoinSheet());
        if (array.size() == 0) {
            throw new LabException("关联工作页为空");
        }*/
        if (StrUtil.isBlankIfStr(entity.getTargetSheet())) {
            throw new LabException("目标sheet为空");
        }
        /*if (StrUtil.isBlankIfStr(entity.getMapperColumn())) {
            throw new LabException("表头映射为空");
        }*/
        return true;
    }
}
